﻿// Copyright (c)  MOKEYISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

using System.Diagnostics;
using NSQL.Generator;

namespace NSQL.Expressions
{
    [DebuggerDisplay("{ToString()}")]
    public abstract class BaseExpression : IExpression
    {
        public string TypeClass => GetType().Name;

        public abstract T Accept<T>(IExpressionVisitor<T> visitor);

        public T ToString<T>(IExpressionProcessor<T> processor) => processor.Process(this);

        public override string ToString() => SqlGenerator.Instance.Generate(this);
        public object Tag { get; set; }
    }
}